﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using SystemAnalizer.Utils;
using SystemAnalizer.Common;
using SystemAnalizer.Models;
using SystemAnalizer.ViewModel;

namespace SystemAnalizer
{
    /// <summary>
    /// Interaction logic for CreateSystem.xaml
    /// </summary>
    public partial class CreateSystem : Window
    {
        private ProgramSettings prog_settings;
        
        private CreateSystemViewModel createsystem_viewmodel; 
        public CreateSystem(ProgramSettings progset,bool isperiodic)
        {
            InitializeComponent();
            this.createsystem_viewmodel = new CreateSystemViewModel(isperiodic);
            this.DataContext = this.createsystem_viewmodel;
            LoadSettings(progset);
        }

        public CreateSystemViewModel Createsystem_viewmodel
        {
            get { return this.createsystem_viewmodel; }
        }
    

        private void LoadSettings(ProgramSettings progset)
        {
            this.prog_settings = progset;
            ProgramSettings.ResourceActivator(this.prog_settings.GetSettingStruct.culture, this.Resources);
        }

        private void SystemSizetxb_TextChanged(object sender, TextChangedEventArgs e)
        {  
            this.createsystem_viewmodel.SystemSizeValidate(this.SystemSizetxb.Text,this.SystemValuesgrd);
        }
    }
}
